import React,{useState,useImperativeHandle,forwardRef} from 'react'

function One(props,ref) {
    const [count,setCount] = useState(0)
    useImperativeHandle(ref,()=>{
        return {
            a:1,
            arr () {
                setCount(preCount=>preCount+1)
            }
        }
    })
    return (
        <div>
            {count}
        </div>
    )
}
export default forwardRef(One)